/**
 * Created by hkc on 2016/10/10.
 */
'use strict';
Zepto(function($){
    //console.log($)
    $('.box').click(function(){
        $('.giftBox').addClass("boxClick")
        //$('.disk').addClass('diskClick')
        $('.giftTip').addClass('giftTipClick')
        $('.opeDyBoxDiv').addClass('dyBoxShow')
        setTimeout(function(){
            $('.opeBoxDiv').addClass('openBoxShow')
            $('.opeDiskDiv').addClass('commonDivAnimateF')
            $('.food').addClass('foodClick')
            $('.hand').addClass('handTrans')
            $('.handTrack4').addClass('handTrackTrans')
        },600)

    })
    $('.food').click(function(){
        freshMeet.call(this)
    })
    var moveOnce = true
    $('.food').on('swipe', function (e, direction) {
        console.log(e, direction);
        if(moveOnce){
            moveOnce = false
            freshMeet.call(this)
        }
    })

    function freshMeet(){
        $('.hand').removeClass('handTrans')
        $('.handTrack4').removeClass('handTrackTrans')
        //$('.handTrackShow').addClass('handTrackShowTrans')
        $('.handTrack5').addClass('handTrackShowTrans5')
        $('.handTrack3').addClass('handTrackShowTrans3')
        $('.handTrack2').addClass('handTrackShowTrans2')
        $('.handTrack1').addClass('handTrackShowTrans1')
        $('.copyhandTrack4').addClass('handTrackShowTrans4')
        var self = this
        setTimeout(function(){
            $('.handTrackShow').hide()
            $(self).removeClass('foodClick')
            $('.foodCut').addClass('foodCutTrans')
            $('.foodInside').addClass('foodInsideShow')
            $('.hat').addClass('hatAnimate')
            setTimeout(function(){
                //$('.hat').hide()
                $('.hat').addClass('hatAnimate2')
                $('.disk').hide()
                $('.opeDiskFoodDone').addClass('commonDivAnimateF')
                $('.diskFoodDone').addClass('diskFoodDoneShow')
                $('.flashBg').addClass('flashBgShow')
                $('.logo').addClass('logoShow')
                setTimeout(function(){
                    $('.opeDiskFoodDone').addClass('diskDoneNone')
                    setTimeout(function(){
                        $('.logo').addClass('logExit')
                        $('.flashNBg').addClass('flashBgShow')
                        $('.cloud').addClass('cloudShow')
                        $('.wave').addClass('waveShow')
                        $('.opeMoneyKing').addClass('commonDivAnimateMoneyF')
                        $('.mainLogo').addClass('logoShow')
                        $('.coupon').addClass('couponShow')
                        $('.bigTitle').addClass('bigTitleShow')
                        $('.title').addClass('titleShow')
                    },500)
                },2000)
            },2500)
        },1000)
    }


})